/*    
	Lirduino - Arduino implementation of the LIRC lircd.conf format
    Copyright (C) 2013  Luke Vibert

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef lirduino_h
#define lirduino_h

class lirduino
{
public:
		float freq;			//carrier frequency in hz
		int bits;
		int header [2];
		int one [2];		// Array of durations: [<pulseone>,<spaceone>]
		int zero [2];		// Array of durations: [<pulsezero>,<spacezero>]
		int ptrail;
		int plead;
		int foot [2];
		int post [2];
		int pre [2];
		int pre_data;
		int pre_data_bits;
		int post_data;
		int post_data_bits;
		int min_repeat;
		long gap;
		
		//lircd.conf flags:
		bool NO_HEAD_REP;
		bool NO_FOOT_REP;
		bool CONST_LENGTH;
		bool REPEAT_HEADER;
		bool REVERSE;
		
		lirduino();
		void sendKey (unsigned long);
		void sendKeyData (unsigned long);
		void enableIROut (int);
		void mark (int);
		void space (int);
		void transmit1 ();
		void transmit0 ();
		void sendHeader ();
		void sendFooter ();
		void sendPreSignal ();
		void sendPostSignal ();
		void sendGap(unsigned long);
};

#endif